<!DOCTYPE html>
<html lang="en">
<head>
	<title>文件重命名</title>
	<meta charset="utf-8">
	<script type="text/javascript" src="/template/js/jquery.js"></script>
</head>
<body>
	<div>
		文件重命名<br /><br />
		<div>
			<form>
				文件绝对路径：<input type="type" class="fileroute" value="" style="width: 30%" /><br /><br />
				查找元素：<input type="type" class="fileserch" value="" /><br /><br />
				替换元素：<input type="type" class="filreplace" value="" /><br /><br />
				<input type="button" onclick="sub()" value="提交" />
			</form>
		</div>
	</div>
</body>
	<script type="text/javascript">
        function sub() {
        	var fileroute = $('.fileroute').val()
        	if (!fileroute|| fileroute == null || fileroute==undefined || fileroute=='undefined') {
				alert('绝对路径 不能为空');
				return
			}

			var fileserch = $('.fileserch').val()
        	if (!fileserch|| fileserch == null || fileserch==undefined || fileserch=='undefined') {
				alert('查找元素 不能为空');
				return
			}

			var filreplace = $('.filreplace').val()
        	if (!fileroute|| fileroute == null || fileroute==undefined || fileroute=='undefined') {
				filreplace = ""
			}

			$.ajax({
			   	type: "POST",
			   	url: "/filerenamereplace",
			   	data: "fileroute="+fileroute+"&fileserch="+fileserch+"&filreplace="+filreplace,
			   	success: function(msg){
			     	alert( msg );
			   	}
			});
        }
    </script>
</html>